import { LayerEnum, RoleCamp, RoleType } from "../../Interfaces/IEnum";
import { IElmentRoot, IRoleBase } from "../../Interfaces/IRole";

/**
 * 角色基类实现
 */
export class RoleBase implements IRoleBase, IElmentRoot {
  isDead: boolean;
  layer: LayerEnum = LayerEnum.actor;
  spriteBase: any;
  no: number;
  roleName: string;
  roleType: RoleType;
  roleCamp: RoleCamp;
  constructor(roleName: string, roleType: RoleType) {
    this.roleName = roleName;
    this.roleType = roleType;
  }
  isRoleType(type: RoleType): boolean {
    return this.roleType == type;
  }

  isRoleCamp(camp: RoleCamp): boolean {
    return this.roleCamp == camp;
  }
  /**
   *  TODO: 未实现销毁 需自行实现
   */
  destroy(dispose?: boolean) {
    this.spriteBase.destroy();
  }
  /**
   *  TODO: 未实现更新 需自行实现
   */
  update() {}
}
